/**
 *
 */
package com.moogene.saad.gameplay.menus;

import java.util.ArrayList;
import java.util.List;

import com.moogene.android.R;
import com.moogene.android.engine.mmi.Book;
import com.moogene.android.engine.mmi.Page;
import com.moogene.android.engine.mmi.widget.Button;
import com.moogene.android.engine.mmi.widget.Widget;
import com.moogene.android.engine.mmi.widget.Widget.OnClickListener;
import com.moogene.saad.gameplay.stages.AttackersManager;
import com.moogene.saad.gameplay.stages.DefendStage;

/**
 * @author 28849218
 *
 */
public class MainMenu extends Page {

	private Button mButtonFriends;
    private Button mBttonBattle;
    private Button mButtonHero;
    private Button mButtonQuit;

    private List<Widget> widgets = new ArrayList<Widget>();

    /* (non-Javadoc)
     * @see com.moogene.android.engine.mmi.Page#onInit()
     */
    @Override
    public void onInit(String... args) {
        setBgImg(R.drawable.menu_bg);
        mButtonFriends = new Button(10, 350, 180, 80);
        mButtonFriends.setText("city");
        mButtonFriends.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(Widget v) {
                Book.getInstance().gotoPage("City.CityPage");
            }
        });

        mBttonBattle = new Button(230, 350, 150, 80);
        mBttonBattle.setText("start");
        mBttonBattle.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(Widget v) {
            	DefendStage.getInstance().start(AttackersManager.getAttackers());
            }
        });

        mButtonHero = new Button(400, 350, 150, 80);
        mButtonHero.setText("hero");
        mButtonHero.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(Widget v) {
            	Book.getInstance().gotoPage("hero.HeroShow");
            }
        });

        mButtonQuit = new Button(600, 350, 150, 80);
        mButtonQuit.setText("exit");


        addLayer(mBttonBattle);
        addLayer(mButtonFriends);
        addLayer(mButtonHero);
        addLayer(mButtonQuit);

//        Session.login("fakeUser", "fakePass");
    }

    /* (non-Javadoc)
     * @see com.moogene.android.engine.mmi.Page#onStart()
     */
    @Override
    public void onStart() {
        // TODO Auto-generated method stub
    }

}
